/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package rigo.ricard.pris.rs.ac.uns.dmi.service.persistence;

import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.ReferenceRegistry;
import com.liferay.portal.service.ServiceContext;

import rigo.ricard.pris.rs.ac.uns.dmi.model.CarPicture;

import java.util.List;

/**
 * The persistence utility for the car picture service. This utility wraps {@link CarPicturePersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author Rigo Richard
 * @see CarPicturePersistence
 * @see CarPicturePersistenceImpl
 * @generated
 */
public class CarPictureUtil {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
	 */

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
	 */
	public static void clearCache() {
		getPersistence().clearCache();
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
	 */
	public static void clearCache(CarPicture carPicture) {
		getPersistence().clearCache(carPicture);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
	 */
	public long countWithDynamicQuery(DynamicQuery dynamicQuery)
		throws SystemException {
		return getPersistence().countWithDynamicQuery(dynamicQuery);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
	 */
	public static List<CarPicture> findWithDynamicQuery(
		DynamicQuery dynamicQuery) throws SystemException {
		return getPersistence().findWithDynamicQuery(dynamicQuery);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
	 */
	public static List<CarPicture> findWithDynamicQuery(
		DynamicQuery dynamicQuery, int start, int end)
		throws SystemException {
		return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
	 */
	public static List<CarPicture> findWithDynamicQuery(
		DynamicQuery dynamicQuery, int start, int end,
		OrderByComparator orderByComparator) throws SystemException {
		return getPersistence()
				   .findWithDynamicQuery(dynamicQuery, start, end,
			orderByComparator);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
	 */
	public static CarPicture update(CarPicture carPicture, boolean merge)
		throws SystemException {
		return getPersistence().update(carPicture, merge);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
	 */
	public static CarPicture update(CarPicture carPicture, boolean merge,
		ServiceContext serviceContext) throws SystemException {
		return getPersistence().update(carPicture, merge, serviceContext);
	}

	/**
	* Caches the car picture in the entity cache if it is enabled.
	*
	* @param carPicture the car picture
	*/
	public static void cacheResult(
		rigo.ricard.pris.rs.ac.uns.dmi.model.CarPicture carPicture) {
		getPersistence().cacheResult(carPicture);
	}

	/**
	* Caches the car pictures in the entity cache if it is enabled.
	*
	* @param carPictures the car pictures
	*/
	public static void cacheResult(
		java.util.List<rigo.ricard.pris.rs.ac.uns.dmi.model.CarPicture> carPictures) {
		getPersistence().cacheResult(carPictures);
	}

	/**
	* Creates a new car picture with the primary key. Does not add the car picture to the database.
	*
	* @param carPicureId the primary key for the new car picture
	* @return the new car picture
	*/
	public static rigo.ricard.pris.rs.ac.uns.dmi.model.CarPicture create(
		long carPicureId) {
		return getPersistence().create(carPicureId);
	}

	/**
	* Removes the car picture with the primary key from the database. Also notifies the appropriate model listeners.
	*
	* @param carPicureId the primary key of the car picture
	* @return the car picture that was removed
	* @throws rigo.ricard.pris.rs.ac.uns.dmi.NoSuchCarPictureException if a car picture with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static rigo.ricard.pris.rs.ac.uns.dmi.model.CarPicture remove(
		long carPicureId)
		throws com.liferay.portal.kernel.exception.SystemException,
			rigo.ricard.pris.rs.ac.uns.dmi.NoSuchCarPictureException {
		return getPersistence().remove(carPicureId);
	}

	public static rigo.ricard.pris.rs.ac.uns.dmi.model.CarPicture updateImpl(
		rigo.ricard.pris.rs.ac.uns.dmi.model.CarPicture carPicture,
		boolean merge)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().updateImpl(carPicture, merge);
	}

	/**
	* Returns the car picture with the primary key or throws a {@link rigo.ricard.pris.rs.ac.uns.dmi.NoSuchCarPictureException} if it could not be found.
	*
	* @param carPicureId the primary key of the car picture
	* @return the car picture
	* @throws rigo.ricard.pris.rs.ac.uns.dmi.NoSuchCarPictureException if a car picture with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static rigo.ricard.pris.rs.ac.uns.dmi.model.CarPicture findByPrimaryKey(
		long carPicureId)
		throws com.liferay.portal.kernel.exception.SystemException,
			rigo.ricard.pris.rs.ac.uns.dmi.NoSuchCarPictureException {
		return getPersistence().findByPrimaryKey(carPicureId);
	}

	/**
	* Returns the car picture with the primary key or returns <code>null</code> if it could not be found.
	*
	* @param carPicureId the primary key of the car picture
	* @return the car picture, or <code>null</code> if a car picture with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static rigo.ricard.pris.rs.ac.uns.dmi.model.CarPicture fetchByPrimaryKey(
		long carPicureId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().fetchByPrimaryKey(carPicureId);
	}

	/**
	* Returns all the car pictures where adId = &#63;.
	*
	* @param adId the ad ID
	* @return the matching car pictures
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<rigo.ricard.pris.rs.ac.uns.dmi.model.CarPicture> findByAdId(
		long adId) throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByAdId(adId);
	}

	/**
	* Returns a range of all the car pictures where adId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param adId the ad ID
	* @param start the lower bound of the range of car pictures
	* @param end the upper bound of the range of car pictures (not inclusive)
	* @return the range of matching car pictures
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<rigo.ricard.pris.rs.ac.uns.dmi.model.CarPicture> findByAdId(
		long adId, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByAdId(adId, start, end);
	}

	/**
	* Returns an ordered range of all the car pictures where adId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param adId the ad ID
	* @param start the lower bound of the range of car pictures
	* @param end the upper bound of the range of car pictures (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of matching car pictures
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<rigo.ricard.pris.rs.ac.uns.dmi.model.CarPicture> findByAdId(
		long adId, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByAdId(adId, start, end, orderByComparator);
	}

	/**
	* Returns the first car picture in the ordered set where adId = &#63;.
	*
	* @param adId the ad ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching car picture
	* @throws rigo.ricard.pris.rs.ac.uns.dmi.NoSuchCarPictureException if a matching car picture could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static rigo.ricard.pris.rs.ac.uns.dmi.model.CarPicture findByAdId_First(
		long adId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			rigo.ricard.pris.rs.ac.uns.dmi.NoSuchCarPictureException {
		return getPersistence().findByAdId_First(adId, orderByComparator);
	}

	/**
	* Returns the first car picture in the ordered set where adId = &#63;.
	*
	* @param adId the ad ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching car picture, or <code>null</code> if a matching car picture could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static rigo.ricard.pris.rs.ac.uns.dmi.model.CarPicture fetchByAdId_First(
		long adId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().fetchByAdId_First(adId, orderByComparator);
	}

	/**
	* Returns the last car picture in the ordered set where adId = &#63;.
	*
	* @param adId the ad ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching car picture
	* @throws rigo.ricard.pris.rs.ac.uns.dmi.NoSuchCarPictureException if a matching car picture could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static rigo.ricard.pris.rs.ac.uns.dmi.model.CarPicture findByAdId_Last(
		long adId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			rigo.ricard.pris.rs.ac.uns.dmi.NoSuchCarPictureException {
		return getPersistence().findByAdId_Last(adId, orderByComparator);
	}

	/**
	* Returns the last car picture in the ordered set where adId = &#63;.
	*
	* @param adId the ad ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching car picture, or <code>null</code> if a matching car picture could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static rigo.ricard.pris.rs.ac.uns.dmi.model.CarPicture fetchByAdId_Last(
		long adId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().fetchByAdId_Last(adId, orderByComparator);
	}

	/**
	* Returns the car pictures before and after the current car picture in the ordered set where adId = &#63;.
	*
	* @param carPicureId the primary key of the current car picture
	* @param adId the ad ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the previous, current, and next car picture
	* @throws rigo.ricard.pris.rs.ac.uns.dmi.NoSuchCarPictureException if a car picture with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static rigo.ricard.pris.rs.ac.uns.dmi.model.CarPicture[] findByAdId_PrevAndNext(
		long carPicureId, long adId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			rigo.ricard.pris.rs.ac.uns.dmi.NoSuchCarPictureException {
		return getPersistence()
				   .findByAdId_PrevAndNext(carPicureId, adId, orderByComparator);
	}

	/**
	* Returns all the car pictures.
	*
	* @return the car pictures
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<rigo.ricard.pris.rs.ac.uns.dmi.model.CarPicture> findAll()
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findAll();
	}

	/**
	* Returns a range of all the car pictures.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of car pictures
	* @param end the upper bound of the range of car pictures (not inclusive)
	* @return the range of car pictures
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<rigo.ricard.pris.rs.ac.uns.dmi.model.CarPicture> findAll(
		int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findAll(start, end);
	}

	/**
	* Returns an ordered range of all the car pictures.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of car pictures
	* @param end the upper bound of the range of car pictures (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of car pictures
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<rigo.ricard.pris.rs.ac.uns.dmi.model.CarPicture> findAll(
		int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findAll(start, end, orderByComparator);
	}

	/**
	* Removes all the car pictures where adId = &#63; from the database.
	*
	* @param adId the ad ID
	* @throws SystemException if a system exception occurred
	*/
	public static void removeByAdId(long adId)
		throws com.liferay.portal.kernel.exception.SystemException {
		getPersistence().removeByAdId(adId);
	}

	/**
	* Removes all the car pictures from the database.
	*
	* @throws SystemException if a system exception occurred
	*/
	public static void removeAll()
		throws com.liferay.portal.kernel.exception.SystemException {
		getPersistence().removeAll();
	}

	/**
	* Returns the number of car pictures where adId = &#63;.
	*
	* @param adId the ad ID
	* @return the number of matching car pictures
	* @throws SystemException if a system exception occurred
	*/
	public static int countByAdId(long adId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countByAdId(adId);
	}

	/**
	* Returns the number of car pictures.
	*
	* @return the number of car pictures
	* @throws SystemException if a system exception occurred
	*/
	public static int countAll()
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countAll();
	}

	public static CarPicturePersistence getPersistence() {
		if (_persistence == null) {
			_persistence = (CarPicturePersistence)PortletBeanLocatorUtil.locate(rigo.ricard.pris.rs.ac.uns.dmi.service.ClpSerializer.getServletContextName(),
					CarPicturePersistence.class.getName());

			ReferenceRegistry.registerReference(CarPictureUtil.class,
				"_persistence");
		}

		return _persistence;
	}

	/**
	 * @deprecated
	 */
	public void setPersistence(CarPicturePersistence persistence) {
	}

	private static CarPicturePersistence _persistence;
}